import logging
from datetime import timedelta
from redis import StrictRedis

class Config(object):
    DEBUG = True
    SECRET_KEY = "123wfdsfd"
    #
    SQLALCHEMY_DATABASE_URI = "mysql+pymysql://root:123456@172.24.200.119/information"
    SQLALCHEMY_TRACK_MODIFICATIONS = False
    #
    REDIS_HOST = "172.24.200.119"
    REDIS_PORT=  6379
    #
    SESSION_TYPE=  "redis"
    SESSION_REDIS= StrictRedis(host=REDIS_HOST,port=REDIS_PORT)
    SESSION_USE_SIGNER = True
    PERMANENT_SESSION_LIFETIME =  timedelta(days=3)
    # 设置日志等级
    LOG_LEVEL = logging.DEBUG


#dev环境
class dev(Config):
    DEBUG = True


#生产环境
class prod(Config):
    DEBUG = False


#qa环境
class qa(Config):
    pass

#提供一个统一入口
config_dict = {
    "dev":dev,
    "prod":prod,
    "qa":qa
}